<?php 
use \PsiFramework\Classes\Util\UI\Printer;
use \PsiFramework\Classes\Util\UI\HTML;

$note = $templateManager->getParameter('note');
if (is_null($note)) $note = 0 ;

$entries = $templateManager->getParameter('entries');
?>
<header id="entete" class="default">
    <div class="contenu">
        <h2 class="slogan"><?php Printer::display($languageManager->getText('ANNUAIRE_PORTAL')); ?></h2>
        <a
            class="btn"
            href="<?php Printer::display(HTML::linkHref("action=Authenticate")); ?>">
            <?php Printer::display($languageManager->getText('LOGOUT')); ?>
        </a>
        <div class="bloc bloc-3">
            <div class="titre_jauge">
                <strong>
                    <?php Printer::display($languageManager->getText('INFORMATION_GAUGE')); ?>
                </strong>
                :&nbsp;
            </div>
            <a
                href="<?php Printer::display(HTML::linkHref('action=ShowHelp')); ?>"
                class="progress-bar">
                <span class="bulle-info bas"><?php Printer::display($languageManager->getText('CLICK_TO_KNOW_MORE')); ?><span class="bulle-fleche"></span></span>
                <span class="progress-img">
                    <span class="progress-masque"></span>
                    <span class="progress-pourcentage" style="width:<?php echo $note; ?>px;"></span>
                </span>
                <span class="progress-num"><?php echo $note; ?> %</span>
            </a>
        </div>
        <nav class="menu-haut">
            <ul>
                <li class="lien-1 prem">
                    <?php
                    echo HTML::link(
                        $languageManager->getText('PERSONAL_INFORMATION'),
                        "action=EditUser",
                        array('class'=>'niv-1')
                    );
                    ?>
                </li>
                <?php
                if (!is_null($entries) && count($entries)>1) {
                ?>
                <li class="lien-2">
                    <?php
                    echo HTML::link(
                        $languageManager->getText('HANDLE_ENTRIES'),
                        "action=Index",
                        array('class'=>'niv-1')
                    );
                    ?>
                    <ul class="sous-menu">
                        <?php 
                        foreach ($entries as $entry) {
                        ?>
                        <li>
                            <?php
                            echo HTML::link(
                                $entry->getName(),
                                "action=ShowProfile&entry_id=".$entry->getId(),
                                array('class'=>'niv-2')
                            );
                            ?>
                        </li>
                        <?php    
                        }
                        ?>
                    </ul>
                </li>
                <?php 
                }
                ?>
                <li class="lien-3 dern">
                    <!--
                    <a href="#" class="niv-1">
                        <?php Printer::display($languageManager->getText('NEW_FEATURES')); ?>
                    </a>
                    -->
                    <?php
                    echo HTML::link(
                        $languageManager->getText('ORDERS_AND_SERVICES'),
                        "#",
                        array('class'=>'niv-1')
                    );
                    ?>
                    <ul class="sous-menu">
                        <li>
                            <?php
                            echo HTML::link(
                                $languageManager->getText('PAST_ORDERS'),
                                "action=ShowOrders",
                                array('class'=>'niv-2')
                            );
                            ?>
                        </li>
                        <li>
                            <?php
                            echo HTML::link(
                                $languageManager->getText('SERVICES_MANAGEMENT'),
                                'action=ShowProfileServices',
                                array('class'=>'niv-2')
                            );
                            ?>
                        </li>
                    </ul>
                </li>
            </ul>
        </nav>
    </div>
</header>
